$(function() {
	
//	获取个人资料
	personal_data(1);
	
	//	帮助注册
	var prevent_repetition = true;
	$(".login_bt1n").on("click", function() {
		if(prevent_repetition) {
			prevent_repetition = false;
			var account_name = $(".account_name_1").val();
			var wx_account = $(".wx_account_1").val();
			var username = $(".username_1").val();
			var code = $(".code_1").val();
			var pwd1 = $(".pwd1_1").val();
			var pwd2 = $(".pwd2_1").val();
			
			var d = {};
			if(!account_name) {
				alert("请输入姓名");
				prevent_repetition = true;
				return false;
			}
			if(!wx_account) {
				alert("请输入微信号");
				prevent_repetition = true;
				return false;
			}
			if(!username) {
				alert("请输入手机号码");
				prevent_repetition = true;
				return false;
			}
			if(!code) {
				alert("请输入推荐码");
				prevent_repetition = true;
				return false;
			}
			if(!pwd1) {
				alert("请输入登录密码");
				prevent_repetition = true;
				return false;
			}
			if(!pwd2) {
				alert("请再次输入登录密码");
				prevent_repetition = true;
				return false;
			}
			if(pwd2 != pwd1) {
				alert("两次密码输入不一致");
				prevent_repetition = true;
				return false;
			}
			d.account_name=account_name;
			d.wx_account=wx_account;
			d.username = username;
			d.code = code;
			d.pwd = pwd1;
			d.chk_pwd=pwd2;
			d.token=token;
			$.ajax({
				type: "post",
				url: url + '/api.php/user/help_reg',
				data: d,
				dataType: 'json',
				success: function(result) {
					if(result.code == '0000') {
						alert(result.msg);
						location.href='index.html';
					} else {
						isErr(result);
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					alert("请求失败：" + XMLHttpRequest.status);
				},
				complete: function() {
					prevent_repetition = true;
				}
			});
		}
	})
})